import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

import Home from '../views/home/index.vue'
import Layout from '../layout/index.vue'

const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      redirect: 'home',
      children: [
        {
          path: '/home',
          name: 'home',
          component: Home,
        },
        {
          path: '/user',
          name: 'user',
          component: () => import('../views/user/index.vue'),
        },
        {
          path: '/ranking',
          name: 'ranking',
          component: () => import('../views/ranking/index.vue'),
        },
      ],
    },
  ],
})

export default router
